using UnityEngine;
using System.Collections;

public class TestGun : MonoBehaviour {
	
	public Rigidbody bullet;
	public Transform bulletSpawn;
	float bulletSpeed = 50f;
	

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
		
		if(Input.GetMouseButton (0)){
			Rigidbody clone;
			clone = Instantiate (bullet,bulletSpawn.position,bulletSpawn.rotation) as Rigidbody;
			clone.velocity = transform.TransformDirection (Vector3.forward * bulletSpeed);
			
		}
	
	}
}
